import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/Login/index.vue'
import Home from '../views/Home.vue'
import Index from '../views/Index.vue'
const router = createRouter({
	history: createWebHistory(import.meta.env.VITE_APP_ENV === 'production' ? '/huizhi' : '/'),
	routes: [
		{
			path: '/',
			redirect: '/login'
		},
		{
			path: '/login',
			name: 'login',
			component: Login,
			meta: { title: '登录' }
		},
		{
			path: '/home',
			name: 'home',
			component: Home,
			meta: { title: '主界面' },
			redirect: '/index',
			children: [
				{
					path: '/index',
					component: Index,
					meta: { title: '首页' }
				}
			]
		}
	]
})

export default router
